package bma.common.netty.handler;

import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelEvent;
import org.jboss.netty.channel.ChannelHandler;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelPipeline;

public class ChannelHandlerContextWrap implements ChannelHandlerContext {

	private ChannelHandlerContext context;

	public ChannelHandlerContextWrap() {
		super();
	}

	public ChannelHandlerContextWrap(ChannelHandlerContext context) {
		super();
		this.context = context;
	}

	public ChannelHandlerContext getContext() {
		return context;
	}

	public void setContext(ChannelHandlerContext context) {
		this.context = context;
	}

	@Override
	public Channel getChannel() {
		return context.getChannel();
	}

	@Override
	public ChannelPipeline getPipeline() {
		return context.getPipeline();
	}

	@Override
	public String getName() {
		return context.getName();
	}

	@Override
	public ChannelHandler getHandler() {
		return context.getHandler();
	}

	@Override
	public boolean canHandleUpstream() {
		return context.canHandleUpstream();
	}

	@Override
	public boolean canHandleDownstream() {
		return context.canHandleDownstream();
	}

	@Override
	public void sendUpstream(ChannelEvent e) {
		context.sendUpstream(e);
	}

	@Override
	public void sendDownstream(ChannelEvent e) {
		context.sendDownstream(e);
	}

	@Override
	public Object getAttachment() {
		return context.getAttachment();
	}

	@Override
	public void setAttachment(Object attachment) {
		context.setAttachment(attachment);
	}

}
